
// 获取滚动条距离顶部的高度
// document.querySelector("#toTop")
//滚动事件
var t = document.querySelector("#toTop");
window.onscroll = function(){
	// console.log(document.documentElement.scrollTop > 1000 || document.body.scrollTop > 1000);
	if(document.documentElement.scrollTop >  1000 || document.body.scrollTop > 1000){
		t.style.display = "block";
	}else{
		t.style.display = "none";
	}
}
//点击返回顶部
t.addEventListener('click',function(){
	// window.scrollTo(0,0);
	window.scrollTo({
		top:0,
		behavior:'smooth'
	})

})


var a = document.querySelector("#a");
var form = document.querySelector("#form");

a.addEventListener("mouseover",function(){
	form.style.display = "block";
})

form.addEventListener("mouseleave",function(){
	form.style.display = "none";
})

